﻿#region File Description
//-----------------------------------------------------------------------------
// OptionsMenuScreen.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace TermitesMagnets
{
    /// <summary>
    /// The options screen is brought up over the top of the main menu
    /// screen, and gives the user a chance to configure the game
    /// in various hopefully useful ways.
    /// </summary>
    class InstructionsMenuScreen : MenuScreen
    {

        #region Initialization


        /// <summary>
        /// Constructor.
        /// </summary>
        public InstructionsMenuScreen()
            : base("Instructions")
        {

            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(back);
        }

        #endregion

        /// <summary>
        /// Draws the menu.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            spriteBatch.Begin();

            string instString1 = "Mouse: Hold left button to move and accelerate. Press right button to stop\n";
            string instString2 = "Keyboard: Hold down arrows to move, Ctrl to stop\n";
            string instString3 = "Activate and deactivate magnet using SpaceBar\n";
            string instString4 = "Objective: Bring as much termites as you can to your home base.";
            string instString5 = "The more termites are inside - the faster it burns!";
            string instString6 = "Power-ups are there - if you're smart, don't let someone else win them!";
            string instString7 = "Oh, and don't expect you're enemies to give in without a fight!";
            SpriteFont font = ScreenManager.Font;
            Color color = Color.White * TransitionAlpha;
            Vector2 origin1 = font.MeasureString(instString1) / 2;
            Vector2 origin2 = font.MeasureString(instString2) / 2;
            Vector2 origin3 = font.MeasureString(instString3) / 2;
            Vector2 origin4 = font.MeasureString(instString4) / 2;
            Vector2 origin5 = font.MeasureString(instString5) / 2;
            Vector2 origin6 = font.MeasureString(instString6) / 2;
            Vector2 origin7 = font.MeasureString(instString7) / 2;
            float scale = 0.75f;

            spriteBatch.DrawString(font, instString1, new Vector2(Game1.GlobalGame.GraphicsDevice.Viewport.Width / 2, 300), color, 0,
                                   origin1, scale, SpriteEffects.None, 0);
            spriteBatch.DrawString(font, instString2, new Vector2(Game1.GlobalGame.GraphicsDevice.Viewport.Width / 2, 330), color, 0,
                                   origin2, scale, SpriteEffects.None, 0);
            spriteBatch.DrawString(font, instString3, new Vector2(Game1.GlobalGame.GraphicsDevice.Viewport.Width / 2, 360), color, 0,
                                   origin3, scale, SpriteEffects.None, 0);
            spriteBatch.DrawString(font, instString4, new Vector2(Game1.GlobalGame.GraphicsDevice.Viewport.Width / 2, 390), color, 0,
                                   origin4, scale, SpriteEffects.None, 0);
            spriteBatch.DrawString(font, instString5, new Vector2(Game1.GlobalGame.GraphicsDevice.Viewport.Width / 2, 420), color, 0,
                                   origin5, scale, SpriteEffects.None, 0);
            spriteBatch.DrawString(font, instString6, new Vector2(Game1.GlobalGame.GraphicsDevice.Viewport.Width / 2, 450), color, 0,
                                   origin6, scale, SpriteEffects.None, 0);
            spriteBatch.DrawString(font, instString7, new Vector2(Game1.GlobalGame.GraphicsDevice.Viewport.Width / 2, 480), color, 0,
                                   origin7, scale, SpriteEffects.None, 0);

            spriteBatch.End();
        }
    }
}
